package ai.people.netmon.warning.mapper;

import ai.people.netmon.framework.domain.warning.entity.WarningAccount;
import ai.people.netmon.framework.domain.warning.request.account.AccountJoinedListRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;

import java.util.List;

/**
 * @author ligua
 * @description 针对表【warning_account(预警账号表)】的数据库操作Mapper
 * @createDate 2022-07-28 17:50:38
 * @Entity ai.people.netmon.framework.domain.warning.entity.WarningAccount
 */
public interface WarningAccountMapper extends BaseMapper<WarningAccount> {


    /**
     * 加入列表分析账户
     *
     * @param userId                   用户id
     * @param accountJoinedListRequest 账户加入列表请求
     * @return {@link List}<{@link WarningAccount}>
     */
    List<WarningAccount> listJoinAnalysisAccount(@Param("userId") Long userId, @Param("accountJoinedListRequest") AccountJoinedListRequest accountJoinedListRequest);


    /**
     * 数加入分析账户
     *
     * @param userId                   用户id
     * @param accountJoinedListRequest 账户加入列表请求
     * @return long
     */
    long countJoinAnalysisAccount(@Param("userId") Long userId, @Param("accountJoinedListRequest") AccountJoinedListRequest accountJoinedListRequest);

    /**
     * 判断账户加入分析
     *
     * @param warningAccount 警告帐户
     * @param userId         用户id
     * @return {@link WarningAccount}
     */
    WarningAccount judgmentAccountJoinAnalysis(@Param("warningAccount") WarningAccount warningAccount, @Param("userId") Long userId);


    /**
     * 判断是否存在
     *
     * @param warningAccount 警告帐户
     * @return {@link WarningAccount}
     */
    WarningAccount judgmentAccountAlreadyExists(@Param("warningAccount") WarningAccount warningAccount);

}




